package com.liuhuanss.voiceprint.dto;

import jakarta.validation.constraints.Email;
import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Size;

/**
 * 注册请求DTO
 * 
 * @author liuhuanss
 * @version 1.0
 */
public class RegisterRequest {

    @NotBlank(message = "用户名不能为空")
    @Size(min = 3, max = 50, message = "用户名长度必须在3-50个字符之间")
    private String username;

    @NotBlank(message = "邮箱不能为空")
    @Email(message = "邮箱格式不正确")
    private String email;

    @NotBlank(message = "密码不能为空")
    @Size(min = 6, message = "密码长度不能少于6个字符")
    private String password;

    private String audioBase64;

    private Boolean enableVoiceprint = false;

    // 默认构造函数
    public RegisterRequest() {}

    // 构造函数
    public RegisterRequest(String username, String email, String password, String audioBase64, Boolean enableVoiceprint) {
        this.username = username;
        this.email = email;
        this.password = password;
        this.audioBase64 = audioBase64;
        this.enableVoiceprint = enableVoiceprint;
    }

    // Getters and Setters
    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getEmail() {
        return email;
    }

    public void setEmail(String email) {
        this.email = email;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getAudioBase64() {
        return audioBase64;
    }

    public void setAudioBase64(String audioBase64) {
        this.audioBase64 = audioBase64;
    }

    public Boolean getEnableVoiceprint() {
        return enableVoiceprint;
    }

    public void setEnableVoiceprint(Boolean enableVoiceprint) {
        this.enableVoiceprint = enableVoiceprint;
    }

    @Override
    public String toString() {
        return "RegisterRequest{" +
                "username='" + username + '\'' +
                ", email='" + email + '\'' +
                ", enableVoiceprint=" + enableVoiceprint +
                ", hasAudio=" + (audioBase64 != null && !audioBase64.isEmpty()) +
                '}';
    }
}